﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using LinqToSqlShared.Mapping;
/// <summary>
/// Summary description for ProductDAO
/// </summary>
public class ProductDAO:AbstractDAO
{
    
	public ProductDAO()
	{
		
	}
    public List<product> readAll() {
        return db.products.ToList();
    }
    public product readByID(int id) {
        return db.products.First(p=>p.ProductID == id );
    }
    public List<product> productInCategory(product p) {
        return p.category.products.ToList();
    }
}